
{{for $foo=0 to count($data["products"])-1 step 3}}
<div class="dgroup dsmall">
    {{for $dsi=$foo to $foo+2 step 1}}
        {{if isset($data["products"][$dsi]["ProductName"])}}
        <div class="ditem d{{$dsi-$foo}}">
                <div class="dphoto">
                    <img class="lazy" data-original="{{if isset($data["products"][$dsi]["Image"])}}{{$data["products"][$dsi]["Image"]}}{{else}}{{/if}}"/>
                    {{if $data["products"][$dsi]["Discontinued"]==1}}<div class="sold-out"></div>{{/if}}
                    
                    <a href="{{base_url()}}sanpham/{{$data["products"][$dsi]["Alias"]}}">
                        <div class="ho50" onclick="//posX(this)">
                            <div class="dship">
                                Giao sản phẩm
                            </div>
                            <div class="dview"></div>
                        </div>
                    </a>
                    <div class="ddisc">-{{$data["products"][$dsi]["Discount"]}}%</div>
                        
                </div>
                <div class="dtit">
                    <a href="{{base_url()}}sanpham/{{$data["products"][$dsi]["Alias"]}}">
                        <h1>
                                {{$data["products"][$dsi]["ProductName"]}}
                        </h1>
                    </a>
                </div>
                <div class="dprice">
                        <div class="dsale">
                                <div>
                                        {{number_format($data["products"][$dsi]["UnitsOnOrder"], 0, ',', '.')}}<sup style="font-size:12px;">đ</sup>
                                </div>
                        </div>
                        <div class="dunitprice">
                                <span class="sf">Trị giá</span><br/>
                                <span class="ss">{{number_format($data["products"][$dsi]["UnitPrice"], 0, ',', '.')}}<sup style="font-size:12px;">đ</sup></span>
                        </div>
                </div>
                <div class="df_time_view">
                        <div class="dtime">
                            
                                <b>{{round((strtotime($data["products"][$dsi]["EndDate"])-strtotime("now"))/(60*60*24))}}</b> ngày 
                                <b>{{round( ((strtotime($data["products"][$dsi]["EndDate"])-strtotime("now"))%(60*60*24))/(60*60) )}}</b> giờ 
                                <b>{{round( (((strtotime($data["products"][$dsi]["EndDate"])-strtotime("now"))%(60*60*24))%(60*60))/60 )}}</b> phút
                        </div>
                        <div class="dview-user hidden">
                                <b>{{$data["products"][$dsi]["Sold"]+$data["products"][$dsi]["ReorderLevel"]}}</b> người đã mua
                        </div>
                </div>
        </div>
        {{/if}}
    {{/for}}
</div>
{{/for}}
